package com.bus.admin.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import com.bus.admin.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bus.admin.bean.LinInfoAll;
import com.bus.admin.bean.result.ResultPage;
import com.bus.admin.controller.model.ApiResultModel;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 张子艺
 * @since 2020-04-01
 */
@Controller
@RequestMapping("/bus/linInfoAll")
public class LinInfoAllController extends BaseController{
     /** 主页面 */
    @RequestMapping("main.html")
    public String main(){
       return  "lininfo/LinInfoAllMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "/addLinInfoAllHtml")
    public String addLinInfoAllHtml( ){
             return "lininfo/LinInfoAllAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/editLinInfoAllHtml")
    public String editLinInfoAllHtml(Integer id ,Model model ){
           model.addAttribute("linInfoAll",linInfoAllService.selectLinInfoAllByIdLinInfoAll(id));
             return "lininfo/LinInfoAllEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "/showLinInfoAllHtml")
    public String showLinInfoAllHtml(Integer id ,Model model ){
           model.addAttribute("linInfoAll",linInfoAllService.selectLinInfoAllByIdLinInfoAll(id));
             return "lininfo/LinInfoAllShow";
    }


    /** 分页查询LinInfoAll
     * @param page  页码
     * @param limit  查几条
     * @param linInfoAll  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "/findLinInfoAllByPage")
    @ResponseBody
    public ResultPage findLinInfoAllByPage(Integer page, Integer limit,LinInfoAll linInfoAll){
             return linInfoAllService.findLinInfoAllByPage(page,limit,linInfoAll);
    }

    /** 添加LinInfoAll
     * @param linInfoAll  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/addLinInfoAll")
    @ResponseBody
    public ApiResultModel saveLinInfoAll(LinInfoAll linInfoAll  ){
             return linInfoAllService.addLinInfoAll(linInfoAll);
    }

    /** 编辑LinInfoAll
     * @param linInfoAll  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "/editLinInfoAll")
    @ResponseBody
    public ApiResultModel editLinInfoAll(LinInfoAll linInfoAll  ){
             return linInfoAllService.editLinInfoAll(linInfoAll);
    }



    /** 删除一条LinInfoAll
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "/delLinInfoAll")
    @ResponseBody
    public ApiResultModel delLinInfoAll( Integer id  ){
             return linInfoAllService.delLinInfoAll(id);
    }


}
